package builder.database;

/**
 * 
 * @author Alex
 */
public class Column {
	private String 	columnName;
	private Table 	table;
	
	public Column(Table table, String columnName) {
		this.table 		= table;
		this.columnName = columnName;
	}
	
	/**
	 * <strong>getColumnName</strong>
	 * 
	 * Gets the column name of this column.
	 * <br/>
	 * For a column "name" in table student
	 * where student has a shortname of "stud"
	 * this method will return "stud.name"
	 * @return
	 */
	public String getFullColumnName() {
		return table.getTableShortName() + "." + columnName;
	}
	
	/**
	 * <strong>getColumnName</strong>
	 * 
	 * Gets the column name of this column.
	 * <br/>
	 * For a column "name" in table student
	 * this method will return "name"
	 * @return
	 */
	public String getColumnName() {
		return columnName;
	}
	
	public Table getTable() {
		return this.table;
	}
}
